use crate::IpAddrType::V6;

fn main() {
    let home = IpAddr{
        kind: IpAddrType::V4,
        address: String::from("127.0.0.1")
    };
    route(&home);

    let loopback = IpAddr{
        kind:IpAddrType::V6,
        address: String::from("::1")
    };
    route(&loopback);
}

fn route(f: &IpAddr){
    println!("{:?} {} ", f, f.address);
}

#[derive(Debug)]
enum IpAddrType{
    V4, V6,
}

#[derive(Debug)]
struct IpAddr{
    kind: IpAddrType,
    address: String
}

